home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2005 February / PCpro_2005_02.ISO / files / opensource / A_Note_4.2.1 / setup.exe / {app} / Server Documents / sendnotes.php < prev    next >
Encoding:
PHP Script  |  2004-09-27  |  926 b   |  38 lines

  1. <?php
  2. // A Note is sending the notes -> store them in the database
  3.  
  4. // Variable init
  5.     include ("init.php");
  6.     $user      = $_GET['user'];
  7.     $password = $_GET['password'];
  8.  
  9.     if ($user == "" || password == "")    {
  10.         echo $xmlstart ."<info>no user or password</info>";
  11.         exit;
  12.     }
  13.  
  14. // Connect to the database    
  15.     include ("connect.php");
  16.         
  17. // Check if the user exists and that the password is right
  18.     include ("validateuser.php");
  19.  
  20. // Everything is ok -> save the notes in the database
  21.     include ("savenotes.php");
  22.  
  23. // Increase the counter that shows how many uploades the user has done
  24.     $query="SELECT * FROM users WHERE user='$user'";
  25.     $reply = mysql_query ($query);
  26.     $num_result = mysql_num_rows ($reply);
  27.  
  28.     $count = mysql_result ($reply, 0, "numlogs");
  29.     $count++;
  30.     $query ="UPDATE `users` SET `numlogs` = '$count' WHERE user = '$user'";
  31.     mysql_query ($query);
  32.     
  33. // Close mysql
  34.     mysql_close();    
  35. ?>
  36.  
  37.  
  38.